package TestCTR;

import java.util.ArrayList;

import org.junit.Test;

import CTRLayer.TrainedCTR;
import ModelLayer.Trained;

public class TestTrainedCTR {

	private TrainedCTR trc = new TrainedCTR();
	private Trained tr = new Trained();
	@Test
	public void testFindAllTrained() {
		ArrayList<Trained> trlist = trc.findAllTrained();
		int id = 0;
		System.out.println("\nElementer i Trained : " + trlist.size() + "\n");
		while (id < trlist.size())
		{
			System.out.println("Name               : " + trlist.get(id).getName());
			System.out.println("TrainingDay        : " + trlist.get(id).getTrainingDay().getTrainingDayID());
			System.out.println("TrainingActivityID : " + trlist.get(id).getTrainingActivity().getTrainingActivityID());
			System.out.println("TrainingDayID      : " + trlist.get(id).getTrainingDay().getTrainingDayID());
			System.out.println("TrainerPerson ID   : " + trlist.get(id).getTrainingDay().getTrainer().getPersonID());
			System.out.println("Trainer Firstname  : " + trlist.get(id).getTrainingDay().getTrainer().getfName());
			System.out.println("Trainer Initialer  : " + trlist.get(id).getTrainingDay().getTrainer().getInitials());
			System.out.println("--------------------------------------------------");
			
			id++;
		}
	}

	@Test
	public void testFindTrainedID() {
		int id = 1;
		tr = trc.findTrainedID(id);
		
		System.out.println("Test of FindTrainedID");
		System.out.println("Name               : " + tr.getName());
		System.out.println("TrainingDay        : " + tr.getTrainingDay().getTrainingDayID());
		System.out.println("TrainingActivityID : " + tr.getTrainingActivity().getTrainingActivityID());
		System.out.println("TrainingDayID      : " + tr.getTrainingDay().getTrainingDayID());
		System.out.println("TrainerPerson ID   : " + tr.getTrainingDay().getTrainer().getPersonID());
		System.out.println("Trainer Firstname  : " + tr.getTrainingDay().getTrainer().getfName());
		System.out.println("Trainer Initialer  : " + tr.getTrainingDay().getTrainer().getInitials());
		System.out.println("--------------------------------------------------");
	}

}
